<?php
$xtpl = new XTemplate("modules/home/adminu.htm");
//--
//--
//--
//--
//--
$add_button = $GUI->button_ren("New","javascript: add('?mod=home&catepath={$_GET[catepath]}&act=admin_task&amp;cid=".$cid."');");
$xtpl->assign("add_button",$add_button);
//--
$delete_button = $GUI->button_ren("Delete","javascript: del('DELETE', document.frmadmin);");
$xtpl->assign("delete_button",$delete_button);
//--
//--
//--
//--
//--
//--
$rs = $DB->ZenDataList('admin','*',"status=1",'admin_id','');
$no=1;
while($row = mysql_fetch_array($rs)){
	$row[no]=$no++;	
	if($no%2!=0)
		$row['class'] = "row1";
	else 
		$row['class'] = "row2";
	//--
	$row[edit_link] = '?mod=home&amp;catepath='.$_GET[catepath].'&amp;act=admin_task&amp;id='.$row[admin_id].'';
	//--
	$xtpl->assign("list",$row);
	$xtpl->parse("center.list");
}
//--
//--
//--
//--
//--
//--
if($_POST['type'] == "DELETE"){
	$checked_delete = $_POST[checked_delete];
	for ($i=0;$i<count($checked_delete);$i++) {
		$delete_list.= $checked_delete[$i].",";
	}
	if($delete_list){
		$delete_list = substr($delete_list,0,strlen($delete_list)-1);
		$delete_split=split(",",$delete_list);
		for($i=0;$i<count($delete_split);$i++){
			$sql_ = "DELETE FROM {$DP}admin WHERE admin_id='{$delete_split[$i]}'";
			mysql_query($sql_);
		}
	}
	$GUI->redir('?mod=home&amp;catepath='.$_GET[catepath].'&amp;act=adminu');
}
//--
//--
//--
//--
//--
?>